package com.uzai.console.entity.wxpubmanage;

import com.uzai.common.entity.BaseEntity;
import com.uzai.console.enums.WxpubAuthStatusEnum;
import com.uzai.console.vo.deviceauth.DeviceAuthVo;
import com.uzai.console.vo.wxpub.DeviceInfoVo;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * @author cen
 * @date 2022-3-22 10:49:58
 */
public class WxpubInfoEntity extends BaseEntity {


    @ApiModelProperty("三方平台appid")
    private Long merId;

    @ApiModelProperty("公众号appid")
    private String wxAppId;

    @ApiModelProperty("公众号appsecret")
    private String wxAppSecret;

    @ApiModelProperty("微信原始id")
    private String wxOriginalId;

    @ApiModelProperty("公众号昵称")
    private String deviceName;

    @ApiModelProperty("公众号备注")
    private String deviceRemark;

    @ApiModelProperty("公众号头像URL")
    private String headImgUrl;

    @ApiModelProperty("授权状态(1 授权成功 , 2 取消授权)")
    private Integer authStatus;

    @ApiModelProperty("授权状态名称")
    private String authStatusName;

    @ApiModelProperty("绑定目标: 0 uzai第三方 , 1 : 本商户的微信第三方")
    private Integer target;

    @ApiModelProperty("删除状态 0-正常 ,1删除 ")
    private Integer delStatus;

    @ApiModelProperty("配置方案id")
    private Long configId;

    @ApiModelProperty("配置方案名称")
    private String configPlanName;

    @ApiModelProperty("关联机器人 列表详情 json数据 , id , name 字段 json")
    private String deviceInfo;

    @ApiModelProperty("设备信息 名称列表")
    private String deviceInfoStr;

    @ApiModelProperty("机器人对象处理")
    private List<DeviceInfoVo> deviceInfoList;

    @ApiModelProperty("公众号首页配置信息")
    private String menu;

    @ApiModelProperty("公众号首页配置 点击事件json ")
    private String menuClick;

    @ApiModelProperty("设备id")
    private String deviceId;

    @ApiModelProperty("到期时间")
    private Integer expireTime;

    @ApiModelProperty("绑定备注信息.")
    private String bindRemark;

    @ApiModelProperty("跳转地址")
    private String redirectUrl;

    @ApiModelProperty("海报背景地址")
    private String posterBgUrl;

    @ApiModelProperty("海报二维码X坐标")
    private Integer qrCodeXAxis;

    @ApiModelProperty("海报二维码Y坐标")
    private Integer qrCodeYAxis;

    //产品功能授权列表
    @ApiModelProperty("产品功能授权列表")
    private List<DeviceAuthVo> deviceAuthVoList;

    @ApiModelProperty("配置方案启用规则（0-用户默认客户端；1-用户当前使用客户端）")
    private int configRule;

    public String getPosterBgUrl() {
        return posterBgUrl;
    }

    public void setPosterBgUrl(String posterBgUrl) {
        this.posterBgUrl = posterBgUrl;
    }

    public Integer getQrCodeXAxis() {
        return qrCodeXAxis;
    }

    public void setQrCodeXAxis(Integer qrCodeXAxis) {
        this.qrCodeXAxis = qrCodeXAxis;
    }

    public Integer getQrCodeYAxis() {
        return qrCodeYAxis;
    }

    public void setQrCodeYAxis(Integer qrCodeYAxis) {
        this.qrCodeYAxis = qrCodeYAxis;
    }

    public String getRedirectUrl() {
        return redirectUrl;
    }

    public void setRedirectUrl(String redirectUrl) {
        this.redirectUrl = redirectUrl;
    }

    public String getBindRemark() {
        return bindRemark;
    }

    public void setBindRemark(String bindRemark) {
        this.bindRemark = bindRemark;
    }

    public String getAuthStatusName() {

        if(authStatus !=1 && StringUtils.isNotBlank(bindRemark)) {
            return  bindRemark;
        }

        return WxpubAuthStatusEnum.getById(authStatus).getDesc();
    }

    public void setAuthStatusName(String authStatusName) {
        this.authStatusName = authStatusName;
    }

    public String getWxAppSecret() {
        return wxAppSecret;
    }

    public void setWxAppSecret(String wxAppSecret) {
        this.wxAppSecret = wxAppSecret;
    }

    public String getMenuClick() {
        return menuClick;
    }

    public void setMenuClick(String menuClick) {
        this.menuClick = menuClick;
    }

    public String getMenu() {
        return menu;
    }

    public void setMenu(String menu) {
        this.menu = menu;
    }

    public String getDeviceInfoStr() {
        return deviceInfoStr;
    }

    public void setDeviceInfoStr(String deviceInfoStr) {
        this.deviceInfoStr = deviceInfoStr;
    }

    public List<DeviceInfoVo> getDeviceInfoList() {
        return deviceInfoList;
    }

    public void setDeviceInfoList(List<DeviceInfoVo> deviceInfoList) {
        this.deviceInfoList = deviceInfoList;
    }

    public Long getConfigId() {
        return configId;
    }

    public void setConfigId(Long configId) {
        this.configId = configId;
    }

    public String getConfigPlanName() {
        return configPlanName;
    }

    public void setConfigPlanName(String configPlanName) {
        this.configPlanName = configPlanName;
    }

    public String getDeviceInfo() {
        return deviceInfo;
    }

    public void setDeviceInfo(String deviceInfo) {
        this.deviceInfo = deviceInfo;
    }

    public Long getMerId() {
        return merId;
    }

    public void setMerId(Long merId) {
        this.merId = merId;
    }

    public String getWxAppId() {
        return wxAppId;
    }

    public void setWxAppId(String wxAppId) {
        this.wxAppId = wxAppId;
    }

    public String getWxOriginalId() {
        return wxOriginalId;
    }

    public void setWxOriginalId(String wxOriginalId) {
        this.wxOriginalId = wxOriginalId;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getDeviceRemark() {
        return deviceRemark;
    }

    public void setDeviceRemark(String deviceRemark) {
        this.deviceRemark = deviceRemark;
    }

    public String getHeadImgUrl() {
        return headImgUrl;
    }

    public void setHeadImgUrl(String headImgUrl) {
        this.headImgUrl = headImgUrl;
    }

    public Integer getAuthStatus() {
        return authStatus;
    }

    public void setAuthStatus(Integer authStatus) {
        this.authStatus = authStatus;
    }

    public Integer getDelStatus() {
        return delStatus;
    }

    public void setDelStatus(Integer delStatus) {
        this.delStatus = delStatus;
    }

    public Integer getTarget() {
        return target;
    }

    public void setTarget(Integer target) {
        this.target = target;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public Integer getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Integer expireTime) {
        this.expireTime = expireTime;
    }

    public List<DeviceAuthVo> getDeviceAuthVoList() {
        return deviceAuthVoList;
    }

    public void setDeviceAuthVoList(List<DeviceAuthVo> deviceAuthVoList) {
        this.deviceAuthVoList = deviceAuthVoList;
    }

    public int getConfigRule() {
        return configRule;
    }

    public void setConfigRule(int configRule) {
        this.configRule = configRule;
    }
}
